#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
//int main()
//{
//    char c;
//    int letters = 0, spaces = 0, digits = 0, others = 0;
//    while ((c = getchar()) != '\n')
//    {
//        if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
//            letters++;
//        else if (c >= '0' && c <= '9')
//            digits++;
//        else if (c == ' ')
//            spaces++;
//        else
//            others++;
//    }
//    printf("character:%d,space:%d,digit:%d,others:%d", letters, spaces, digits, others);
//   
//
//	return 0;
//}
int main()
{
	int n =0 ; int letters = 0, spaces = 0, digits = 0, others = 0;
	scanf("%d", &n);
	int i = 1;
	getchar();
	for (i = 1;i <= n;i++)
	{
		
		
		char c = getchar();
		
		if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
			letters++;
			        else if (c >= '0' && c <= '9')
			            digits++;
			        else if (c == ' ')
			            spaces++;
			        else
			            others++;
	}
	printf("character:%d,space:%d,digit:%d,others:%d", letters, spaces, digits, others);

	return 0;
}